<?php

/**
 * Created by PhpStorm.
 * User: 72925
 * Date: 2018/11/23
 * Time: 9:26
 * order: 登陆授权相关操作
 */
namespace app\index\controller;


use think\Controller;


class Test extends Controller{

  public function safety()
  {	
		$random_string = '';
		try{
			 $fp = @fopen('/dev/urandom','rb');
			 if ($fp !== false) {
	                $random_string .= @fread($fp, 16);
	                $pr_bits_arr = unpack('H*', $random_string);
	                $random_string = $pr_bits_arr[1];
	                @fclose($fp);
	            }
		} catch( \Exception $e){

			error_log($e->getMessage());

		}	
		return $random_string;
    
	}

}      // echo _3rd_session(16);
